<?php
class Category extends CI_Controller {
    public function __construct(){
        parent::__construct();
    }

    public function index() {
        // $this->load->view("front_end/home", array('id' => 'thoduong', 'data' => 'phuongnh ....'));
    }

    public function show() {
        $caption_id = $this->uri->segment(3);
        require_once './application/core/sql.php';
        $ary_data = array();
        $ary_data['action'] = $caption_id;
        $this->load->library('session');
        $this->session->set_userdata('action', $caption_id);

        $ary_param = array(
            'file_name' => 'front_end/category.sql',
            'key'       => 'get_list_poetic',
            'param'     => array($caption_id)
        );
        $res = Sql::exec($ary_param);
        $ary_data['list_poetic'] = $res;

        $ary_param = array(
            'file_name' => 'front_end/category.sql',
            'key'       => 'get_category_caption',
            'param'     => array($caption_id)
        );
        $res = Sql::exec($ary_param);
        $ary_data['caption'] = $res[0];

        $ary_param = array(
            'file_name' => 'front_end/category.sql',
            'key'       => 'get_category',
            'param'     => array()
        );

        $res = Sql::exec($ary_param);

        $ary_data['list_category'] = $res;
        $this->load->view("front_end/home", $ary_data);
        // $this->load->view("front_end/home", array('id' => 'thoduong_show', 'data' => 'Song gon trang gian buon diep diep'));
    }
}
?>